<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约</title>
    <link rel="stylesheet" href="../css/page-health-order.css"/>
    <style>
        .top_e {
            position: fixed;
            right: 10px;
            bottom: 40px;
            background: rgba(204, 200, 255, 0.6);
            border-radius: 15px;
            cursor: pointer;
            display: none;
            width: 60px;
            height: 60px;
        }

        .top_e:hover {
            color: white;
            background: #1296DB;
        }
    </style>
</head>

<body data-spy="scroll" data-offset="150">
<!--演示内容开始-->
<div class="headeline"></div>

<div class="app" id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">传智健康</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>

    <div id="return-top" class="top_e">
        <img src="../img/top.png" width="32" id="img">
        <div style="width:60px;margin:auto;">
            <p id='font' style="font-size:17px;margin-left:10px;display:none;">返回<br>顶部</p>
        </div>
    </div>

    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="list-column1">
            <ul class="list">
                <li class="list-item" v-for="setmeal in setmealList">
                    <a class="link-page" :href="'setmeal_detail.html?id='+setmeal.id">
                        <img class="img-object f-left" :src="'http://qgg5hsnp8.hd-bkt.clouddn.com/'+setmeal.img" alt="">
                        <div class="item-body">
                            <h4 class="ellipsis item-title">{{setmeal.name}}</h4>
                            <p class="ellipsis-more item-desc">{{setmeal.remark}}</p>
                            <p class="item-keywords">
                                <span>{{setmeal.sex == '0' ? '性别不限' : setmeal.sex == '1' ? '男':'女'}}</span>
                                <span>{{setmeal.age}}</span>
                            </p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="top">
        <span title="Top" id="topArrow"></span>
    </div>
</div>
<!--演示内容结束-->
<div style="height:100px;"></div>

<!-- 页面 css js -->
<link rel="stylesheet" href="../css/page-health-index.css" />
<link rel="stylesheet" href="../css/page-health-login.css" />
<link rel="stylesheet" href="../plugins/elementui/index.css" />
<script src="../plugins/jquery/dist/jquery.min.js"></script>
<script src="../plugins/vue/vue.js"></script>
<script src="../plugins/vue/axios-0.18.0.js"></script>
<script src="../plugins/elementui/index.js"></script>

<!--<script src="../js/page-health-order.js"></script>-->
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            setmealList: []//模型数据，用于套餐列表展示
        },
        mounted() {
            //发送ajax请求，获取所有的套餐数据，赋值给setmealList模型数据，用于页面展示
            axios.get("/setmealMobile/getAllSetmeal.do").then((res) => {
                if (res.data.flag) {
                    //查询成功，给模型数据赋值
                    this.setmealList = res.data.data;
                } else {
                    //查询失败，弹出提示信息
                    this.$message.error(res.data.message);
                }
            });
        },
        methods: {
            function() {
                //点击回到顶部的元素
                $(".backToTop").click(function () {
                    //以1秒的间隔返回顶部
                    $('body,html').animate({scrollTop: 0}, 1000);
                });
                //实现回到顶部元素的渐显与渐隐
                $(window).scroll(function () {
                    //判断距离，当距离较小时，隐藏，当距离较大时显示
                    if ($(window).scrollTop() > 20) {
                        //以1秒的间隔渐显元素
                        $(".backToTop").fadeIn(1000);
                    } else {
                        //以1秒的间隔渐隐元素
                        $(".backToTop").fadeOut(1000);
                    }
                });

            }
        }
    });

</script>
<script>
    $(function () {
        // 控制按钮的显示和消失
        $(window).scroll(function () {
            if ($(window).scrollTop() > 300) {
                $('#return-top').fadeIn(300);
            }
            else {
                $('#return-top').fadeOut(200);
            }
        });
    });
    // 点击按钮，使得页面返回顶部
    $("#return-top").click(function () {
        scrollTo(0, 0);
    });
    // 鼠标悬浮按钮之上，图片消失，文字显示
    $(".top_e").mouseover(function () {
        $("#img").hide();
        $("#font").show();
    });

    //鼠标离开，文字消失，图片显示。
    $(".top_e").mouseout(function () {
        $("#font").hide();
        $("#img").show();
    });

    $(window).scroll(function () {
        var scrollTop = $(this).scrollTop();
        var scrollHeight = $(document).height();
        var windowHeight = $(this).height();
        if (scrollHeight - scrollTop - windowHeight <= 300) {
//当滚动条滚动到距离底部还有300px的时候加载类容
        } else {
//当滚动条滚动到距离底部大于300px的时候加载类容
        }
    });
</script>
</body>